package com.mmd.gateway;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

import java.net.InetAddress;

@Slf4j
@ComponentScan(basePackages = {"com.mmd"})
@SpringBootApplication
public class GateWayApplication implements CommandLineRunner {
    @Value("${server.port}")
    private int port;

    public static void main(String[] args) {
        SpringApplication.run(GateWayApplication.class,args);
    }

    @Override
    public void run(String... args) throws Exception {
        log.info("启动完毕");
        InetAddress address = InetAddress.getLocalHost();
        log.info("接口文档: http://"+address.getHostAddress()+":"+port+"/doc.html");
    }
}
